Record
A data type that represents a set of values of different types. Used to define
data structures. Not typically used to describe hardware, but useful for high
level modelling.
Syntax
type NewName is
record
ElementName, ... : DataType;
... ;
end record [NewName];
Placement
PACKAGE Pack IS
...
END PACKAGE Pack;
|
PACKAGE BODY Pack IS
...
END PACKAGE BODY Pack;
|
Blk:BLOCK
...
BEGIN
...
END BLOCK Blk;
|
ENTITY Ent IS
...
BEGIN
...
END ENTITY Ent;
|
ARCHITECTURE Arc OF Ent IS
...
BEGIN
...
END ARCHITECTURE Arc;
|
CONFIGURATION Conf OF Ent IS
...
END CONFIGURATION Conf;
|
Proc:PROCESS(...)
...
BEGIN
...
END PROCESS Proc;
|
PROCEDURE P(...) IS
...
BEGIN
...
END PROCEDURE P;
|
FUNCTION F(...) RETURN Tp IS
...
BEGIN
...
END FUNCTION F;
|
Things to remember
Not all synthesis tools support record types.
Synthesis
Values of a record types are synthesized as a bundle of wires, structured
according to the elements of the record.
Not all synthesis tools support records.
Tips
The values within a record can be read or written using a selected name.
Use record types together with access types to create dynamic data
structures for high level modelling.
Example
type Floating is
record
Sign: Bit;
Mantissa, Exponent: Integer;
end record;
variable A, B: Floating;
...
A.Mantissa := A.Mantissa + B.Mantissa;
B := A;
See Also
Name, Type, Access, Array
|